/**============================================================================
 Confidential Information - Limited distribution to authorized persons only.
 This software is protected as an unpublished work under the U.S. Copyright
 Act of 1976.

 Copyright (c) 2011, BluePhoenix Solutions, Inc. All rights reserved.
 ----------------------------------------------------------------------------
 file......: Note.java
 Author....: Vyacheslav Kovalyov
 Created...: 28.10.11

 Description:

 ============================================================================*/
package ru.monyag.pred.core.notepad;

import java.util.List;

import static ru.monyag.pred.core.utils.PredCoreStringUtils.parseTags;

/**
 * @author Vyacheslav Kovalyov
 * @version 1.0
 */
public class Note {

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public List<String> getTags() {
        return tags;
    }

    public void setTags(List<String> tags) {
        this.tags = tags;
    }

    public void setTags(String tags) {
        this.tags = parseTags(tags);
    }

    public String getTagsString() {
        return parseTags(tags);
    }

    public boolean addTag(String text) {
        return !tags.contains(text) && tags.add(text);
    }

    private String date;
    private String title;
    private String message;
    private List<String> tags;
}
